package com.cntcdt.api.db.dao;

import java.util.List;

import com.cntcdt.api.db.dao.base.NoSearchUserIdDaoBase;
import com.cntcdt.api.db.model.NoSearchUserIdModel;

/**
 * 这是cdt_no_search_userId的Dao实现类
 */
public class NoSearchUserIdDao extends NoSearchUserIdDaoBase {
	/**
	 * NoSearchUserIdDao对象
	 */
	private static NoSearchUserIdDao instance = new NoSearchUserIdDao();

	/**
	 * 默认构造方法
	 */
	private NoSearchUserIdDao() {
	}

	/**
	 * 获得对象实例
	 */
	public static NoSearchUserIdDao getInstance() {
		return instance;
	}

	/**
	 * 根据用户id查询
	 * 
	 * @param userId
	 * @return
	 */
	public NoSearchUserIdModel findByUserId(int userId) {
		String sql = "select * from " + TABLE + " where userId = ?";
		Object[] paramObjs = { userId };
		List<NoSearchUserIdModel> modelList = this.queryModelList(sql, paramObjs);
		if (modelList.size() > 0) {
			return modelList.get(0);
		}
		return null;
	}
}
